package com.hs.sfzy.controller;

import com.github.pagehelper.PageInfo;
import com.hs.sfzy.entity.Mynotice;
import com.hs.sfzy.entity.Question;
import com.hs.sfzy.service.MynoticeService;
import com.hs.sfzy.service.QuestionService;
import com.hs.sfzy.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: sfzyBackEnd
 * @BelongsPackage: com.hs.sfzy.controller
 * @ClassName MynoticeController
 * @Author: 陈千鱼不是鱼
 * @CreateTime: 2024-10-28  14:23
 * @Description: 我的通知
 * @Version: 1.0
 */
@RestController
@RequestMapping("/mynotice")
@Api(tags = "我的通知")
@RequiredArgsConstructor
public class MynoticeController {

    private final MynoticeService mynoticeService;

    @GetMapping("/page")
    @ApiOperation("分页查询")
    public Result page(
            @RequestParam(required = false, defaultValue = "1") Integer pageNum,
            @RequestParam(required = false, defaultValue = "5") Integer pageSize
    ) {
        PageInfo<Mynotice> info = mynoticeService.page(pageNum,pageSize);

        return Result.success(info);
    }
}
